@extends('shopWx.global')

@section('content')
<div class="page page-current" id="index">
    <header class="bar bar-nav">
        <h1 class="title">{{ $store[$storeID]->name }}</h1>
    </header>
    <div class="content pull-to-refresh-content infinite-scroll" id="infinite-index" data-ptr-distance="100">
        <!-- 默认的下拉刷新层 -->
        <div class="pull-to-refresh-layer">
            <div class="preloader"></div>
            <div class="pull-to-refresh-arrow"></div>
        </div>
        <!-- Slider -->
        <div data-pagination="#swiper-main" data-space-between="50" class="swiper-container">
            <div class="swiper-wrapper">
                @foreach($slide as $v)
                    <div class="swiper-slide" onclick="@if($v->link != '') $.router.load('{{ $v->link }}'); @endif"><img src="{{ action('ImgController@getPicture', ['sourceName' => $v->thumb, 'size' => '375x250']) }}" width="100%"></div>
                @endforeach
            </div>
            <div id="swiper-main" class="swiper-pagination"></div>
        </div>
        <!-- 滑动目录 -->
        <div data-pagination="#swiper-menu" data-space-between="10" data-slides-per-column="1" data-slides-per-column-fill="row" class="swiper-container swiper-menu">
            <div class="swiper-wrapper">
                <?php $n = ceil(count($classify)/8);?>
                @for($i = 0; $i < $n; $i++)
                <div class="swiper-slide">
                    <div class="row">
                    <?php $k = 0; ?>
                    @foreach($classify as $v)
                        @if($k < ($i+1)*8 && $k >= $i*8)
                        <div class="col-25">
                            <a href="{{ action('Shop\ListController@getIndex', ['typeID' => $v->id]) }}" class="link external">
                                <img src="{{ action('ImgController@getPicture', ['sourceName' => $v->icon, 'size' => '50x50']) }}">
                                <span>{{ $v->name }}</span>
                            </a>
                        </div>
                        @endif
                        <?php $k++; ?>
                    @endforeach
                    </div>
                </div>
                @endfor
            </div>
            <div id="swiper-menu" class="swiper-pagination"></div>
        </div>
        <!-- 滑动目录END -->
        <!-- 推荐 -->
        @if(count($recommend) == 5)
        <div class="content-title">
            <h3 style="text-align: center">── おすすめ ──</h3>
        </div>
        <div class="content-padded recommend">
            <div class="row no-gutter row-line">
                @foreach($recommend as $v)
                    @if($v->width == 750)
                        <div class="col-50" onclick="$.router.load('{{ action('Shop\ListController@getIndex', ['recommendID' => $v->id]) }}')"><img src="{{ action('ImgController@getPicture', ['sourceName' => $v->thumb, 'size' => '375x525']) }}" width="100%"></div>
                    @endif
                @endforeach
                <div class="col-50 right-img">
                    <div class="row no-gutter">
                        @foreach($recommend as $v)
                            @if($v->width == 375)
                            <div class="col-50" onclick="$.router.load('{{ action('Shop\ListController@getIndex', ['recommendID' => $v->id]) }}')"><img src="{{ action('ImgController@getPicture', ['sourceName' => $v->thumb, 'size' => '375x525']) }}" width="100%"></div>
                            @endif
                        @endforeach
                    </div>
                </div>
            </div>
        </div>
        @endif
        <!-- 推荐END -->
        <!--列表-->
        <div class="content-title">
            <h3 style="text-align: center">── 商品リスト ──</h3>
        </div>
        <div class="list-menu-placeholder hidden"></div>
        <div id="my-element" class="list-menu">
            <div class="buttons-row content-nav">
                <!-- Link to 1st tab, active -->
                <a href="{{ action('Shop\IndexController@getIndex', ['sort' => 'hot']) }}" class="external sortLink button @if(isset($_GET['sort']) && $_GET['sort'] == 'hot'){{ 'active' }}@endif">売れ筋</a>
                <!-- Link to 2nd tab -->
                <a href="{{ action('Shop\IndexController@getIndex', ['sort' => 'lp']) }}" class="sortLink button external @if(isset($_GET['sort']) && $_GET['sort'] == 'lp'){{ 'active' }}@endif">価格の安い順</a>
                <!-- Link to 3rd tab -->
                <a href="{{ action('Shop\IndexController@getIndex', ['sort' => 'new']) }}" class="sortLink button external @if(isset($_GET['sort']) && $_GET['sort'] == 'new'){{ 'active' }}@endif">最新商品</a>
            </div>
        </div>
        <div class="content-padded recommend">
            <div class="list-block media-list" id="page-data-index" data-url="{{ action('Shop\IndexController@getIndexAjax') }}" data-page="1" data-typeid="{{ isset($_GET['typeID']) ? $_GET['typeID'] : '' }}" data-sort="{{ isset($_GET['sort']) ? $_GET['sort'] : '' }}">
                <ul>
                    @foreach($goods as $v)
                        <li data-id="{{ $v->id }}" data-thumb="{{ action('ImgController@getPicture', ['sourceName' => $v->thumb, 'size' => '110x90']) }}" data-title="{{ $v->title }}" data-price="{{ $v->realAmount }}" data-intro="{{ $v->abstract }}" data-sv="135" data-num="12">
                            <div class="item-content">
                                <a href="#" class="item-slicer-link item-media">
                                    <img class="cart-image lazy" src="{{ asset('style/shopWx/img/lazy.png') }}" data-original="{{ action('ImgController@getPicture', ['sourceName' => $v->thumb, 'size' => '110x90']) }}">
                                </a>
                                <div class="item-inner">
                                    <div class="item-title-row no-icon">
                                        <div class="item-title">{{ $v->title }}</div>
                                        <div class="item-after">{{ $v->realAmount }} 円</div>
                                    </div>
                                    <div class="item-subtitle">販売量 {{ $v->hit }} 件</div>
                                    <div class="item-text">{{ $v->abstract }}</div>
                                    <div class="item-buy">
                                        <div class="row no-gutter">
                                            <div class="col-40"></div>
                                            <div class="col-20 subtract">
                                                <i class="fa fa-cart-arrow-down fa-2x"></i>
                                            </div>
                                            <div class="col-20"></div>
                                            <div class="col-20 plus">
                                                <i class="fa fa-cart-plus fa-2x"></i>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </li>
                    @endforeach
                </ul>
            </div>

        </div>
        <!--列表结束-->
        <!-- 加载提示符 -->
    </div>
    @include('shopWx.footer-menu')
</div>
@endsection